package com.coocaa.typhoon.api.third.elasticsearch.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

import java.time.LocalDateTime;

/**
 * @author bijiahao
 * @date : 2025/10/22 09:10
 * @description
 */
@Data
@Document(indexName = "user_file_doc")
@Setting(shards = 3, replicas = 1)
public class UserFileDoc {
    @Id
    private String id;

    @Field(type = FieldType.Keyword)
    private String userId;

    @Field(type = FieldType.Keyword)
    private String fileType;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String filePath;

    @Field(type = FieldType.Object)
    private String metaDataJson;   // 直接存 JSON 字符串即可

    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    private LocalDateTime createdDate;

    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    private LocalDateTime lastUpdateDate;
}
